Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update templates to calculate rnwPath for *.sln files #13572

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Aug 14, 2024

Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to ..\node_modules\react-native-windows\.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

Note: Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Why

Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

What

See above.

Screenshots

N/A

Testing

Verified that the path is now generated.

Changelog

Should this change be included in the release notes: yes

Update templates to calculate rnwPath for *.sln files

Microsoft Reviewers: Open in CodeFlow

@jonthysell jonthysell requested review from a team as code owners August 14, 2024 17:09
@jonthysell
Copy link
Contributor Author

@shirakaba I believe this PR should alleviate some of the roadblocks in your expo+monorepo work.

@shirakaba
Copy link

Fantastic, thank you so much!

@jonthysell jonthysell merged commit 39f6540 into microsoft:main Aug 20, 2024
55 checks passed
@jonthysell jonthysell deleted the dynamicsln branch August 20, 2024 18:49
jonthysell added a commit to jonthysell/react-native-windows that referenced this pull request Aug 26, 2024
This PR backports microsoft#13572 to 0.75.

## Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to `..\node_modules\react-native-windows\`.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

**Note:** Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

### Why
Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

### What
See above.

## Screenshots
N/A

## Testing
Verified that the path is now generated.

## Changelog
Should this change be included in the release notes: _yes_

Update templates to calculate rnwPath for *.sln files
jonthysell added a commit to jonthysell/react-native-windows that referenced this pull request Aug 26, 2024
This PR backports microsoft#13572 to 0.74.

## Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to `..\node_modules\react-native-windows\`.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

**Note:** Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

### Why
Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

### What
See above.

## Screenshots
N/A

## Testing
Verified that the path is now generated.

## Changelog
Should this change be included in the release notes: _yes_

Update templates to calculate rnwPath for *.sln files
jonthysell added a commit that referenced this pull request Aug 26, 2024
This PR backports #13572 to 0.75.

## Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to `..\node_modules\react-native-windows\`.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

**Note:** Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

### Why
Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

### What
See above.

## Screenshots
N/A

## Testing
Verified that the path is now generated.

## Changelog
Should this change be included in the release notes: _yes_

[0.75] Update templates to calculate rnwPath for *.sln files
jonthysell added a commit that referenced this pull request Aug 26, 2024
This PR backports #13572 to 0.74.

## Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to `..\node_modules\react-native-windows\`.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

**Note:** Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

### Why
Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

### What
See above.

## Screenshots
N/A

## Testing
Verified that the path is now generated.

## Changelog
Should this change be included in the release notes: _yes_

[0.74] Update templates to calculate rnwPath for *.sln files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants